<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="Page.Page"   %>
<%@ page import="java.util.*"%>
<%@ page import="GridCommodity.GridCommodity"%>
<%@ page import="GridCommodity.GridCommodityShow"%>
<%@ page import="java.sql.*" %>
<html>
  <head>
    <title>格子中热门商品</title>
  </head>
  <body>
    <form name="From1" method="POST" action="GridCommodityShow.jsp">
	  	<table width="1000" border="20" height="600" align=center>
	  	<tr height="10" valign=top border="10"><td align=center></td></tr>
	  	<tr>
	  	<td>
	  	<table>
	  	<%   GridCommodityShow db =new GridCommodityShow();
	         ResultSet rs=db.CalFiveGridCommodity();
  	         
  	         while(rs.next())
  	         {
  	        	 
  	        		      GridCommodity  GridCommodity=new GridCommodity();
	  	        		  GridCommodity.setComID(rs.getString(1));
	  	        		  GridCommodity.setComName(rs.getString(2));
	  	        		  GridCommodity.setConKind(rs.getString(3));
	  	        		  GridCommodity.setShowDate(rs.getString(4));
	  	        		  GridCommodity.setDescribe(rs.getString(5));
	  	        		  GridCommodity.setComImage(rs.getString(6));
	  	        		  GridCommodity.setSellCount(rs.getInt(7));
	  	        		  GridCommodity.setRemCount(rs.getInt(8));
	  	        		  GridCommodity.setViewCount(rs.getInt(9));
	  	        		  GridCommodity.setComPrice(rs.getFloat(10));
	  	        		  GridCommodity.setComInf(rs.getString(11));
	  	        		  GridCommodity.setGridID(rs.getInt(12));
	  	        		  GridCommodity.setRecency(rs.getInt(13));
		            	 String saveurl=request.getRealPath("/")+GridCommodity.getComImage();
		                 out.print("<td width=180 border=1>");
		            	 out.print("<table width=160 border=1>");
		            	 out.print("<tr align=left valign=top >");
		            	 out.print("<td width=160>");
		            	 out.print("<a href='GridCommodityDetailed.jsp?jp="+"GridCommodityShow.jsp"+"&GridComID="+GridCommodity.getComID()+"'>");
		            	 out.print("<img border=0 width=150 height=200 src=");
		            	 out.print("../"+GridCommodity.getComImage());
		            	 out.print("></a>");
		                 out.print("</td>");
		                 out.print("<tr>");
		                
		                 out.print("<td align=center>");
		                
		                 out.print("<a href='GridCommodityDetailed.jsp?jp="+"GridCommodityShow.jsp"+"&GridComID="+GridCommodity.getComID()+"'>");
		                 out.print(GridCommodity.getComName());
		                 out.print("</a>");
		                 out.print("</td>");
		                 out.print("</tr>");
		                 
		                 out.print("<tr>");
		                 out.print("<td align=center>");
		                 out.print("￥"+GridCommodity.getComPrice());
		                 out.print("</td>");
		                 out.print("</tr>");
		                 out.print("<tr>");
		                 out.print("<td align=center>");
		                 out.print(GridCommodity.getRecency()+"成新");
		                 out.print("</td>");
		                 out.print("</tr>");
		                 out.print("</table>");
		                 out.print("</td>");
		                 
		        }
   		 %>
   		 </table>
   		 </td>
   		 </table >
  	</form>	
  </body>
</html>
